package com.bestcem.xm.member.entity.pojo;

import com.bestcem.xm.member.entity.mysql.FootprintEntity;
import lombok.Getter;
import lombok.Setter;

import java.util.Date;

/**
 * 示例服务
 *
 * @author yf.wang <yf.wang@idiaoyan.com>
 * @version V1.0
 * @date 2021/10/9
 */

@Getter
@Setter
public class FootprintDO {
    private String id;
    /**
     * 企业标识
     */
    private String orgId;

    /**
     * 联系人标识
     */
    private String memberId;

    /**
     * 足迹类型
     */
    private Integer type;

    /**
     * 数据源标识，工单取工单id，答卷取答卷seq，联系人取联系人id
     */
    private String sourceKey;

    /**
     * 足迹内容
     */
    private String content;

    /**
     * 足迹产生时间
     */
    private Date footprintTime;

    private Integer isSample;

    /**
     * 创建时间
     */
    private Date createTime;

    /**
     * 更新时间
     */
    private Date updateTime;

    public static FootprintEntity toEntity(FootprintDO footprintDo) {
        if (footprintDo == null) {
            return null;
        }
        FootprintEntity entity = new FootprintEntity();
        entity.setContent(footprintDo.getContent());
        entity.setCreateTime(footprintDo.getCreateTime());
        entity.setFootprintTime(footprintDo.getFootprintTime());
        entity.setId(footprintDo.getId());
        entity.setMemberId(footprintDo.getMemberId());
        entity.setOrgId(footprintDo.getOrgId());
        entity.setSourceKey(footprintDo.getSourceKey());
        entity.setType(footprintDo.getType());
        entity.setIsSample(footprintDo.getIsSample());
        entity.setUpdateTime(footprintDo.getUpdateTime());
        return entity;
    }

    public static FootprintDO toDo(FootprintEntity footprintEntity) {
        if (footprintEntity == null) {
            return null;
        }
        FootprintDO footprintDo = new FootprintDO();
        footprintDo.setContent(footprintEntity.getContent());
        footprintDo.setCreateTime(footprintEntity.getCreateTime());
        footprintDo.setFootprintTime(footprintEntity.getFootprintTime());
        footprintDo.setId(footprintEntity.getId());
        footprintDo.setMemberId(footprintEntity.getMemberId());
        footprintDo.setOrgId(footprintEntity.getOrgId());
        footprintDo.setSourceKey(footprintEntity.getSourceKey());
        footprintDo.setType(footprintEntity.getType());
        footprintDo.setIsSample(footprintEntity.getIsSample());
        footprintDo.setUpdateTime(footprintEntity.getUpdateTime());
        return footprintDo;
    }

}
